﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace AlbonWeb.Manager.OrderManager.ashx
{
    /// <summary>
    /// Summary description for SendEmail
    /// </summary>
    public class SendEmail : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write(buyCloth(context));
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        protected string buyCloth(HttpContext context)
        {
            if (context.Request["companyname"] != null && context.Request["body"] != null)
            {
                BLL.ClothBuyBLL clothbuybll = new BLL.ClothBuyBLL();
                return clothbuybll.buyCloth(context.Request["companyname"].ToString(), context.Request["body"].ToString());
            }
            else {
                return "Parameters Not Passed!";
            }
        }
    }
}